<template>
  <div>
    <el-table :data="seckillList" border style="width: 100%">
      <el-table-column prop="id" label="编号"></el-table-column>
      <el-table-column prop="title" label="秒杀名称"></el-table-column>
      <el-table-column prop="date" label="状态">
        <template slot-scope="scope">
          <el-button type="primary" v-if="scope.row.status==1">启用</el-button>
          <el-button type="info" v-else>禁用</el-button>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button type="primary" @click="willEdit(scope.row.id)">编辑</el-button>
          <v-delete @del="del(scope.row.id)"></v-delete>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
  data() {
    return {
      bannerList: []
    };
  },
  props: ["flag"],
  computed: {
    ...mapGetters({
      seckillList:"seckill/seckillList"
    })
  },
  components: {},
  methods: {
    ...mapActions({
      reqSeckList:"seckill/reqSeckList",
      reqSeckDel:"seckill/reqSeckDel",
    }),
    // 点击删除
    del(id) {
      this.reqSeckDel(id)
    },
    // 点击编辑
    willEdit(id) {}
  },
  mounted() {
    this.reqSeckList()
  }
};
</script>
<style lang='less' scoped>
</style>